<template>
    <div class="main">
        <search-bar :barShow="barShow" @change-barShow="changeBarShow"></search-bar>

        <router-view :carList="carList" @addCar="addCar" @delCarItem="delCarItem"></router-view>
    </div>
</template>



<script>
import searchBar from './components/searchBar.vue'

export default {
    data() {
        return {
            barShow: true,
            carList: [],
        }
    }, components: {
        searchBar,
    }, methods: {
        changeBarShow(bul) {
            this.barShow = bul
        }, addCar(item) {
            //加入购物车
            if (this.carList.indexOf(item) === -1) {
                this.carList.push(item)
            }
        }, delCarItem(newCarList) {
            // this.carList = newCarList
            for (let i = 0; i < this.carList.length; i++) {
                console.log(this.carList[i]);
                for (var j in newCarList) {
                    console.log(newCarList[j].name);
                    if (this.carList[i] == newCarList[j].name) {
                        this.carList.splice(i, 1)
                    }
                }
            }
        }
    }
}
</script>

<style lang="scss">
@import "./assets/css/base.css";

* {
    margin: 0;
    padding: 0;
    font-size: 14px;
    list-style: none;
    font-style: normal;
}

a {
    text-decoration: none;
    color: black;
}

a:visited {
    color: #000000;
}

.blank {
    height: 43.8px;
}

.download {
    position: fixed;
    z-index: 3;
    background-color: #fff;
    width: 100%;
    border-bottom: solid 1px #eee;

    .adv {
        width: 92%;
        margin: 0 auto;
        height: 55px;
        display: flex;
        align-items: center;

        .logo {
            width: 35px;
            height: 35px;
            background: url(https://static.sonkwo.com/frontend/assets/1954a7a3c05bee88c449cbf19167f887.png) no-repeat;
            background-size: contain;
        }

        .introduce {
            display: flex;
            flex-direction: column;
            margin-left: 8px;
            width: 169px;
            flex: 1;
        }

        .button {
            width: 99px;
            height: 30px;
            line-height: 30px;
            background-color: #ff9800;
            text-align: center;
            color: white;
            margin-right: 11px;
            border-radius: 2px;
        }

        .cancel {
            width: 21px;
            height: 21px;
            background-image: url(https://static.sonkwo.com/frontend/assets/2219571a3a4ca97b05eed9337d8fee11.png);
        }
    }
}

.head {
    position: fixed;
    z-index: 2;
    background-color: #fff;
    width: 100%;

    .head_item {
        width: 92%;
        margin: 0 auto;
        height: 44px;
        display: flex;

        .bar_l {
            width: 64%;
            min-width: 289px;

            ul {
                display: flex;
                height: 100%;
                line-height: 44px;
                color: #85858c;

                li {
                    font-size: 14px;
                    margin-right: 7.3%;
                    position: relative;

                    a {
                        color: #999;
                    }
                }

                .active {
                    font-weight: 700;
                    font-size: 16px;

                    a {
                        color: #000000;
                    }
                }

                .active::after {
                    content: " ";
                    display: block;
                    position: absolute;
                    height: 3px;
                    border-radius: 2px;
                    width: 15px;
                    margin: auto;
                    bottom: 0;
                    left: 0;
                    right: 0;
                    background-color: #ff6d3f;
                }
            }
        }

        .bar_r {
            display: flex;
            flex: 1;
            align-items: center;
            justify-content: space-between;

            .search {
                width: 21px;
                height: 21px;
                background-image: url(./assets/img/search.png);
                background-size: contain;
                background-repeat: no-repeat;
                position: relative;
                top: 2px;
            }

            .xiaoxi {
                width: 21px;
                height: 21px;
                background-image: url(./assets/img/xiaoxi.png);
                background-size: contain;
                background-repeat: no-repeat;
            }
        }
    }
}

.container {
    width: 100%;
    background: #f4f4f4;
    overflow: hidden;

    .swiper-container-category {
        .swiper-wrapper {
            .swiper-slide {
                img {
                    border-radius: 10px;
                }
            }
        }

        padding-top: 20px;
        position: relative;
        width: 350px;
        margin-left: 15px;

    }
}

.gamebox {
    width: 100%;
    margin: 0 auto;

    .title {
        padding: 10px 0px;
        width: 92%;
        margin: 0 auto;

        p {
            font-weight: 700;
            font-size: 16px;
        }
    }

    .content {
        margin: 0 auto;
        position: relative;
        width: 92%;
        height: 160px;
        position: relative;

        img {
            width: 100%;
            height: 100%;
            border-radius: 10px;
        }

        .textBox {
            color: white;
            width: 97%;
            height: 136px;
            padding: 12px 0;
            position: absolute;
            top: 0;
            left: 10px;
            background: linear-gradient(291deg, rgba(0, 0, 0, 0) 0%, #000000 100%);
            border-radius: 10px;

            .text {
                font-weight: 700;
                margin-bottom: 10px;
            }

            .time {
                display: flex;
                width: 100%;
                height: 36.8px;
                align-items: center;

                .van-count-down {
                    color: #ee0a24;
                }

                span {
                    text-align: center;
                    line-height: 18px;
                    width: 18px;
                    height: 18px;
                    display: inline-block;
                    // background-color: #ee2929;
                    border-radius: 3px;
                    margin-left: 5px;

                    &.colon {
                        display: inline;
                        // margin: 0 4px;
                        font-size: 12px;
                        background-color: none;
                        position: relative;
                        top: 2px;
                        color: #ff5722;
                    }

                    &.block {
                        display: inline-block;
                        width: 20px;
                        height: 20px;
                        color: #fff;
                        font-size: 12px;
                        text-align: center;
                        background-color: #ee0a24;
                        line-height: 20px;
                    }
                }

                i {
                    padding: 0 4px;
                }
            }

            .check_all {
                margin-top: 10px;

                span {
                    font-size: 12px;
                    background: #222;
                    border-radius: 0px 5px 5px 0px;
                    padding: 5px 10px;
                    margin-left: -10px;
                }

                i {
                    padding: 0px 6px;
                }
            }
        }
    }

    .store {
        width: 92%;
        margin: 0 auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        // margin-top: 20px;

        .store_item {
            position: relative;

            .status {
                span {
                    font-size: 12px;
                    position: absolute;
                    top: 5px;
                    left: 0;

                    &.newlowest {
                        background-image: url(https://static.fhyx.com/images/application/pc/com/fhyx_c_newlowest.png);
                        padding: 2px 5px;
                        background-size: contain;
                        color: white;
                        background-repeat: no-repeat;

                    }

                    &.lowest {
                        background-image: url(https://static.fhyx.com/images/application/wap/hk/fhyx_icon1.png);
                        padding: 2px 5px;
                        background-size: contain;
                        color: white;
                        background-repeat: no-repeat;

                    }
                }

            }

            font-size: 0px;
            width: 169px;
            padding: 10px 0;

            img {
                width: 100%;
                border-radius: 8px;
            }

            p {
                font-weight: 700;
                margin-top: 5px;
                font-size: 13px;
                padding: 10px 0;
            }

            .onsele {
                background-color: #ff5722;
                padding: 0 4px;
                font-size: 12px;
                color: white;
                margin-right: 3px;
                border-radius: 2px;
            }

            .pri {
                font-size: 12px;

                i {
                    font-weight: 700;
                }
            }

            .orgpri {
                font-size: 12px;
                color: #c2c2c5;
                text-decoration: line-through;
            }
        }
    }
}

.hotsales {
    padding-top: 20px;
    width: 92%;
    margin: 0 auto;

    ul {
        position: static;
        width: 100%;
        display: flex;

        li {
            text-align: center;
            color: #85858c;
            height: 30px;
            width: 18%;
            position: relative;
        }

        .active {
            color: #222;
            font-weight: 700;
        }

        .active::after {
            content: " ";
            display: block;
            position: absolute;
            height: 2px;
            width: 20px;
            margin: auto;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: #ff6d3f;
        }
    }
}

.hotsalesItem {
    .store {
        width: 92%;
        margin: 0 auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;

        .store_item {
            font-size: 0px;
            width: 100%;
            padding: 10px 0;
            display: flex;
            position: relative;

            img {
                width: 150px;
                height: 89px;
                border-radius: 8px;
            }

            p {
                display: inline-block;
                font-weight: 700;
                margin-top: 5px;
                font-size: 13px;
            }

            .onsele {
                background-color: #ff5722;
                padding: 0 4px;
                font-size: 12px;
                color: white;
                margin-right: 3px;
                border-radius: 2px;
                font-weight: normal;
                margin-left: 10px;
            }

            .pri {
                font-size: 12px;

                i {
                    font-weight: 700;
                }
            }

            .orgpri {
                font-size: 12px;
                color: #c2c2c5;
                text-decoration: line-through;
                margin-left: 10px;
            }

            .status {
                padding: 0 5px 0 0;

                span {
                    font-size: 12px;
                    position: absolute;
                    top: 5px;
                    left: 0;

                    &.newlowest {
                        background-image: url(https://static.fhyx.com/images/application/pc/com/fhyx_c_newlowest.png);
                        padding: 2px 5px;
                        background-size: contain;
                        color: white;
                        background-repeat: no-repeat;

                    }

                    &.lowest {
                        background-image: url(https://static.fhyx.com/images/application/wap/hk/fhyx_icon1.png);
                        padding: 2px 5px;
                        background-size: contain;
                        color: white;
                        background-repeat: no-repeat;

                    }
                }

            }

            .hotsalesItem_inc {
                display: flex;
                flex-direction: column;
                flex: 1;
                justify-content: space-between;
                margin-left: 20px;
            }
        }
    }
}

.footer {
    width: 100%;
    position: fixed;
    bottom: 0px;
    z-index: 2;
    display: flex;
    background-color: #fff;
}

.footer_item {
    width: 25%;
    text-align: center;

    p {
        font-size: 12px;
    }

    div {
        display: inline-block;
        height: 25px;
        width: 25px;
        background-size: contain;
    }
}

.shop {
    background: url(https://club.sonkwo.cn/36b9d0fe5acb36ffbe1a906bab3029c6.png);
}

.talk {
    background: url(https://www.sonkwo.cn/52ee029ea160eddb58200585057bd5a4.png);
}

.shopcar {
    background: url(https://static.sonkwo.com/frontend/assets/4edd2c7c364852716efef4f362dc28ff.png);
}

.mine {
    background: url(https://static.sonkwo.com/frontend/assets/749ad242a87ead1d9c3652791d99529e.png);
}

.coupon {
    width: 92%;
    margin: 0 auto;
    height: 25vw;
    background: url(https://static.sonkwo.com/frontend/assets/ad132d6d7f689cf2d07b9b99c6f341b0.png) no-repeat;
    background-size: 100%;
    display: flex;
    background-repeat: no-repeat;
    align-items: center;

    .coupon-left {
        padding-left: 5.5%;
        text-align: center;

        b {
            font-size: 30px;
        }

        span {
            position: relative;
            bottom: 5px;
        }

        p {
            font-size: 12px;
            color: #8b572a;
        }
    }

    .coupon-center {
        flex: 1;
        margin-left: 6%;

        p {
            font-size: 12px;
            color: #8b572a;
        }

        i {
            font-size: 13px;
        }
    }

    .coupon-right {
        width: 18%;
    }
}

.publishers {
    display: flex;
    flex-wrap: wrap;
    background-color: #383d50;
    padding-top: 10px;

    .publishers_item {
        width: 32%;
        height: 94px;
        padding: 1px 2px;
        display: flex;
        align-items: center;
        justify-content: space-around;

        img {
            max-width: 100%;
        }
    }
}

.container {
    .search {
        width: 100%;
        background-color: #fff;
        height: 75px;
        display: flex;
        align-items: center;

        .search_item {
            text-align: center;
            width: 25%;
            height: 67.2px;
            margin-top: 10px;

            img {
                width: 40px;
                height: 40px;
            }

            p {
                margin-top: 7px;
                font-size: 12px;
            }
        }
    }
}

.goodsbox {
    position: relative;
    width: 100%;
    background-color: #fff;
    z-index: 1;

    p {
        padding: 10px 0px;
        margin-left: 15px;
        font-weight: 700;
    }

    .mask {
        height: 170px;
        position: absolute;
        width: 100%;
        background: linear-gradient(0deg, rgba(255, 246, 239, 1) 50%, rgba(247, 247, 247, 0) 97%);

        img {
            width: 100%;
            height: 100%;
        }
    }

    .goodsboxlist {
        position: relative;
        z-index: 2;
        display: flex;
        width: 92%;
        margin: 0 auto;
        margin-top: 55px;
        justify-content: space-between;
        flex-wrap: wrap;
        padding-bottom: 50px;

        .goodsboxitem {
            width: 49%;
            margin-top: 10px;

            .imgbox {
                text-align: center;
                border-radius: 8px 8px 0 0;
                height: 117px;
                background-color: #f5f5f5;
            }

            p {
                font-size: 12px;
                font-weight: normal;
            }

            b {
                text-align: left;
                padding-left: 15px;
            }
        }
    }
}

.check_more {
    height: 42px;
    text-align: center;
    background-color: #fff;
    text-align: center;
    border: 1px solid #f5f5f5;
    line-height: 42px;
    font-size: 12px;
    color: #999;
}

.blank2 {
    width: 100%;
    height: 20px;
}

.seach_bar {
    position: fixed;
    width: 100%;
    height: 44px;
    background-color: #333;
    top: 0;
    z-index: 2;

    .seach_game {
        display: flex;
        align-items: center;
        width: 100%;
        height: 44px;
    }

    .return {
        width: 8%;
        text-align: center;
        margin-left: 10px;

        p {
            // font-size: 25px;
            width: 16px;
            height: 16.8px;
            background-image: url(./assets/img/fanhui.png);
            background-repeat: no-repeat;
            background-size: contain;
        }
    }

    .seach_input {
        flex: 1;
        display: flex;
        height: 30px;
        align-items: center;
        padding: 0px 10px;
        background-color: #666;
        border-radius: 5px;

        .find {
            width: 21px;
            height: 21px;
            background-image: url(./assets/img/search2.png);
            background-size: contain;
            background-repeat: no-repeat;
            padding-right: 5px;
        }

        .seach {
            flex: 1;
            outline: none;
            border: none;
            background-color: #666;
            color: #fff;
            font-size: 12px;
        }
    }

    .seach_button {
        span {
            padding: 0px 15px;
            color: #999;
        }
    }

    .seach_title {
        width: 100%;
        position: fixed;
        border-bottom: solid 1px #f5f5f5;
        background-color: #fff;

        ul {
            display: flex;

            li {
                text-align: center;
                width: 20%;
                height: 44px;
                line-height: 44px;

                p {
                    display: inline-block;
                    height: 95%;
                    padding: 0px 8px;
                    font-size: 13px;
                    color: #666;
                }
            }

            p {
                position: relative;
                display: flex;
                flex-direction: column;

                span {
                    position: absolute;
                    font-size: 12px;
                }
            }
        }

        .active {
            color: #ff5722;
            border-bottom: solid 2px #ff5722;
        }
    }
}

::-webkit-input-placeholder {
    color: #ffffff;
}

.blank3 {
    height: 44px;
    width: 100%;
}

.seach_list {
    margin-top: 10px;

    .hotsalesItem {
        .store {
            .store_item {
                img {
                    border-radius: 0px;
                }

                .hotsalesItem_inc {
                    margin-left: 15px;

                    p {
                        font-weight: normal;

                        i {
                            border-radius: 0px;
                        }
                    }

                    .money {
                        color: #ff5722;

                        .onsele {

                            color: #ff5722;
                            background-color: #fff;
                        }
                    }

                    ul {
                        display: flex;
                        flex: 1;
                        align-items: center;

                        li {
                            text-align: center;
                            display: block;
                            font-size: 12px;
                            background-color: #f5f5f5;
                            color: #666;
                            padding: 2px 5px;
                            margin-right: 5px;
                        }
                    }
                }
            }
        }
    }
}
</style>